/**
     *
     * @param date 日期
     * @param showType false 返回2023-01-01 true 返回23/1/1
     */
export function formatDate(date: string | any, showType: boolean) {
    if (!date) {
      return "";
    }
    if (isDateString(date)) {
      date = new Date(date);
    }
    if (showType) {
      const fullYear = date.getFullYear(); // 获取四位年份，如 2023
      const twoDigitYear = String(fullYear).slice(-2); // 获取后两位，如 "23"
      return `${twoDigitYear}/${date.getMonth() + 1}/${date.getDate()}`;
    } else {
      let fMonth = date.getMonth() + 1;
      let fDate = date.getDate();
      if (fMonth < 10) {
        fMonth = "0" + fMonth;
      }
      if (fDate < 10) {
        fDate = "0" + fDate;
      }
      return `${date.getFullYear()}-${fMonth}-${fDate}`;
    }
    function isDateString(value: any) {
      return Object.prototype.toString.call(value) === "[object String]";
    }
  } 